<template>
  <div>
    <el-card v-permission="'monitor:add'" class="box-card">
      <p>请在夜静人深的时候操作</p>
      <el-button type="primary" @click="clearRubbishPicture">一键清理 阿里云OSS中 不被引用的图片</el-button>
    </el-card>
  </div>
</template>
<script>
import { clearRubbishPicture } from '@/api/user'

export default {
  name: 'Monitor',
  methods: {
    async clearRubbishPicture() {
      const response = await clearRubbishPicture()
      if (response.code === 200) {
        this.$message.success(response.message)
      } else {
        this.$message.error(response.message)
      }
    }
  }
}
</script>
<style scoped>
.box-card {
  width: 330px;
  margin: 20px 0;
}

p {
  text-align: center;
  font-size: 12px;
  color: #8c939d;
}

</style>
